import request from "@/utils/request";

// 获取商品列表
export function productList(data) {
  return request({
    url: "/api/v1/admin/products",
    method: "get",
    params: data,
  });
}

// 新增商品
export function addProduct(data) {
  return request({
    url: "/api/v1/admin/products",
    method: "post",
    data,
  });
}
// 修改商品
export function editProduct(id, data) {
  return request({
    url: "/api/v1/admin/products/" + id,
    method: "put",
    data,
  });
}

// 删除商品

export function deleteProduct(id) {
  return request({
    url: "/api/v1/admin/products/" + id,
    method: "delete",
  });
}
